<template>
	<view class="rule-setting-page">
		<view class="title">其他</view>
	<!-- 	<view class="vip">
			<image class="vip-icon" width="80" height="25"  fit="cover" src="/static/icon/vip.png" />
		</view> -->
			<view class="space-h-20"></view>
			<view class="space-h-20"></view>
		<MenuList :menus="vipMenus" :size="50"/>
<!-- 			<view class="space-h-20"></view>
			<view class="space-h-20"></view>
		<view class="free-fun">
			免费功能
		</view> -->
<!-- 			<view class="space-h-20"></view>
		<MenuList :menus="freeFunmenusListOne"/>
		<view class="space-h-20"></view>
		<MenuList :menus="freeFunmenusListTwo"/> -->
	</view>
</template>

<script setup lang="ts">
	import { ref} from 'vue'
	import MenuList from "./menuList.vue"	
	import { mock } from "@/utils/index"
		
	const kefuType = () => {

		if(mock.isLogged()){
			return {
				mode: ['kefu', 'mock'],
				callback: () => {
						// const openServices = () => {
						// 	  // #ifdef MP-WEIXIN  
						// 	  // 这里是微信小程序特有的代码  
						// 	  wx?.openCustomerServiceChat({  
						// 		extInfo: {  
						// 		  url: 'https://work.weixin.qq.com/kfid/kfc7b21166a8a8542e0'  // 你可以根据需要传递额外的信息  
						// 		},  
						// 		corpId: 'wwa5aa0bdcad89bbc5', // 你的企业微信corpId  
						// 		success(res) {  
						// 		  console.log('成功打开客服聊天', res);  
						// 		},  
						// 		fail(err) {  
						// 		  console.error('打开客服聊天失败', err);  
						// 		}  
						// 	  });  
						// 	  // #endif 
							
						// };
						// openServices()
						
						// 快手和抖音联系客服是直接打电话
						uni.makePhoneCall({
							phoneNumber:"4008113985",
							success(res) {
								console.log('res')
							},
							fail(res) {
								uni.showToast({
									title:"拨打失败",
									icon:"error"
								})
							}
						})
				}
			}
		} else {
			return {
				mode: ['kefu', 'mock'],
			}
		}
	}
		
	const vipMenus = ref([
		{
			iconPath: '/static/icon/authCheck.png',
			pageJumpPathUrl: '/pagesA/authCheck/index',
			name:'权限自检',
			type:{
				mode: ["mock", 'authCheck']
			}
		},
		{
			iconPath: '/static/icon/help.png',
			pageJumpPathUrl: '/pagesA/help/index',
			name:'帮助',
			type:{
				mode: ["mock", 'help']
			}
		},
		{
			iconPath: '/static/icon/customerService.png',
			pageJumpPathUrl: '/pagesA/kefu/index',
			name:'客服',
			type:{
				mode: ["mock", 'help']
			}
		},
		// {
		// 	iconPath: '/static/icon/customerService.png',
		// 	pageJumpPathUrl: '/pagesA/customerService/index',
		// 	name:'联系客服',
		// 	type: kefuType()
		// },
		// {
		// 	iconPath: '/static/icon/wx-manage.png',
		// 	pageJumpPathUrl: '/pagesB/miniProgramManage/index',
		// 	name:'小程序管理'
		// }
	])
	
	// const freeFunmenusListOne = ref([
	// 	{
	// 		iconPath: '/static/icon/new-app.png',
	// 		pageJumpPathUrl: '/pagesB/newInstallApp/index',
	// 		name:'新安装应用'
	// 	},
	// 	// {
	// 	// 	iconPath: '/static/icon/child-hidden.png',
	// 	// 	pageJumpPathUrl: '/pagesB/iconHidden/index',
	// 	// 	name:'隐藏孩子图标'
	// 	// },
	// 	{
	// 		iconPath: '/static/icon/count-mange.png',
	// 		pageJumpPathUrl: '/pagesB/appStatistics/index',
	// 		name:'应用统计'
	// 	},
	// 	{
	// 		iconPath: '/static/icon/use-detail.png',
	// 		pageJumpPathUrl: '/pagesB/useDetail/index',
	// 		name:'应用使用详情'
	// 	}
	// ])
	// const freeFunmenusListTwo = ref([
	// 	{
	// 		iconPath: '/static/icon/unbind-manage.png',
	// 		pageJumpPathUrl: '/pagesC/unbind/index',
	// 		name:'临时解绑'
	// 	},
	// 	{
	// 		iconPath: '/static/icon/child-hidden.png',
	// 		pageJumpPathUrl: '/pagesA/position/index',
	// 		name:'定位'
	// 	},
	// 	{
	// 		iconPath: '/static/icon/whitelist-name.png',
	// 		pageJumpPathUrl: '/pagesC/addDesktop/index',
	// 		name:'添加到桌面'
	// 	},
	// 	// {
	// 	// 	iconPath: '/static/icon/new-app.png',
	// 	// 	pageJumpPathUrl: '/pagesB/newInstallApp/index',
	// 	// 	name:'新安装应用'
	// 	// },
	// 	// {
	// 	// 	iconPath: '/static/icon/whitelist-name.png',
	// 	// 	pageJumpPathUrl: '/pagesB/appWhiteList/index',
	// 	// 	name:'应用白名单'
	// 	// }
	// ])
	
	
</script>

<style scoped lang="scss">
	.rule-setting-page{
		background-color: #fff;
		margin-right: 20upx;
		margin-bottom: 20upx;
		border-radius: 15upx;
		padding: 26upx 17upx;
		.title{
			font-size: 32upx;
			color: #333333;
			font-weight: 800;
		}
		
		.vip{
			width: 166upx;
			height: 50upx;
			overflow: hidden;
			margin: 20upx 0 26upx 0; 
		}
		.space-h-20{
			width:100%;
			height: 20upx;
		}
		
		.free-fun{
			margin: 17upx 0;
			font-family: PingFang SC, PingFang SC;
			font-weight: 800;
			font-size: 24upx;
			color: #333333;
		}
	}
</style>